import request from "@/utils/request";
import { EventExhibitionQuery, EventExhibitionPageResult, EventExhibitionForm, EventExhibition } from "./model";

/**
 * 活动展览API
 */
class EventExhibitionAPI {

  /**
   * 板块内容分类分页数据
   * @param queryParams 
   * @returns 
   */
  static getPage(queryParams?: EventExhibitionQuery) {
    return request<any, EventExhibitionPageResult>({
      url:
        "/eventExhibition/getPage?currentPage=" +
        queryParams?.pageNum +
        "&size=" +
        queryParams?.pageSize,
      method: "post",
      data: queryParams,
    });
  }

  /**
   * 获取活动展览列表
   * @param data 
   * @returns 
   */
  static getList(data: EventExhibitionQuery) {
    return request<any, EventExhibition[]>({
      url: "/eventExhibition/getList",
      method: "post",
      data: data,
    });
  }


  /**
   * 新增活动展览
   * @param data 
   * @returns 
   */
  static add(data: EventExhibitionForm) {
    return request({
      url: "/eventExhibition/add",
      method: "post",
      data: data,
    });
  }
  /**
   * 修改活动展览
   * @param data 
   * @returns 
   */
  static update(data: EventExhibitionForm) {
    return request({
      url: "/eventExhibition/edit",
      method: "post",
      data: data,
    });
  }

  static getInfo(data: EventExhibitionForm) {
    return request<EventExhibition>({
      url: "/eventExhibition/getInfo",
      method: "post",
      data: data,
    });
  }

  /**
   * 删除活动展览
   * @param data 
   * @returns 
   */
  static delete(data: EventExhibitionForm) {
    return request({
      url: "/eventExhibition/delete",
      method: "post",
      data: data,
    });
  }

  /**
   * 获取未关联的图片分页数据
   * @param queryParams 
   * @returns 
   */
  static getPageNoRelative(queryParams?: EventExhibitionQuery) {
    return request<any, EventExhibitionPageResult>({
      url:
        "/eventExhibition/getPageNoRelative?currentPage=" +
        queryParams?.pageNum +
        "&size=" +
        queryParams?.pageSize,
      method: "post",
      data: queryParams,
    });
  }

  static getPageRelative(queryParams?: EventExhibitionQuery) {
    return request<any, EventExhibitionPageResult>({
      url:
        "/eventExhibition/getPageRelative?currentPage=" +
        queryParams?.pageNum +
        "&size=" +
        queryParams?.pageSize,
      method: "post",
      data: queryParams,
    });
  }

  /**
   * 添加到活动展览关联表
   * @param data 
   * @returns 
   */
  static addToRelative(data: EventExhibitionForm) {
    return request({
      url: "/eventExhibition/addToRelative",
      method: "post",
      data: data,
    });
  }

  /**
   * 删除模块图片
   * @param data 
   * @returns 
   */

  static removeEventExhibitionRelative(data: EventExhibitionForm) {
    return request({
      url: "/eventExhibition/removeEventExhibitionRelative",
      method: "post",
      data: data,
    });
  }
}

export default EventExhibitionAPI;
